<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <form id="form">
        <input type="text" id="username">
        <input type="text" id="password">
        <button id="setup">重置</button>
    </form>

    <script>
        var text = document.getElementById("form")
        var setup = document.getElementById("setup")
        setup.onclick = function () {
            form.reset();
        }

        var username = document.getElementById("username")
        username.oninput = function (e) {
            console.log(e.target.value);
        }
        username.onselect = function (e) {
            console.log("选中了");
            console.log(e.target.value);
        }
        var password = document.getElementById("password")
        password.onchange = function (e) {
            console.log(e.target.value);
        }


    </script>
</body>

</html>